<!DOCTYPE html>
<meta charset="utf-8">
<#include "../../business/common/common.ftl"/>

<style>
    div {
        overflow: scroll;
    }

</style>
<div class="layui-fluid">
    <table class="layui-table table" style="text-align: center;" id="dataTable" tableType="dataTable">
        <tr class="layui-bg-gray">
            <th style="text-align: center;" rowspan="3">序号</th>
            <th style="text-align: center;" rowspan="3">回迁项目名称</th>
            <th style="text-align: center;" colspan="3">基础信息</th>
            <th style="text-align: center;" colspan="10">选房情况</th>
            <th style="text-align: center;" colspan="2">店铺情况</th>
            <th style="text-align: center;" colspan="2">储物间情况</th>
            <th style="text-align: center;" colspan="8">申购车位情况</th>
            <th style="text-align: center;" rowspan="3">专项维修基金(元)</th>
            <th style="text-align: center;" colspan="3">财务情况</th>

        </tr>
        <tr class="layui-bg-gray">
            <th style="text-align: center;" colspan="2">征迁安置情况</th>
            <th style="text-align: center;" rowspan="2" width="6%">项目开始时间</th>
            <th style="text-align: center;">小户型</th>
            <th style="text-align: center;" colspan="6">普通型</th>
            <th style="text-align: center;">复式楼房</th>
            <th style="text-align: center;" colspan="2">房源合计</th>
            <th style="text-align: center;" rowspan="2">数量(套)</th>
            <th style="text-align: center;" rowspan="2">面积(㎡)</th>
            <th style="text-align: center;" rowspan="2">数量(套)</th>
            <th style="text-align: center;" rowspan="2">面积(㎡)</th>
            <th style="text-align: center;" colspan="3">已选车位</th>
            <th style="text-align: center;" colspan="3">已结清车位</th>
            <th style="text-align: center;" colspan="2">车位申购费(元)</th>
            <th style="text-align: center;" rowspan="2">应发放金额(元)</th>
            <th style="text-align: center;" rowspan="2">应收款金额(元)</th>
            <th style="text-align: center;" rowspan="2">合计(元)</th>
        </tr>
        <tr class="layui-bg-gray">
            <th style="text-align: center;">选房号数量</th>
            <th style="text-align: center;">已回迁面积（㎡）</th>
            <th style="text-align: center;">一室(套)</th>
            <th style="text-align: center;">一室二厅(套)</th>
            <th style="text-align: center;">二室二厅(套)</th>
            <th style="text-align: center;">三室二厅(套)</th>
            <th style="text-align: center;">四室二厅(套)</th>
            <th style="text-align: center;">五室二厅(套)</th>
            <th style="text-align: center;">合计(套)</th>
            <th style="text-align: center;">(套)</th>
            <th style="text-align: center;">数量(套)</th>
            <th style="text-align: center;">面积(㎡)</th>
            <th style="text-align: center;">普通车位</th>
            <th style="text-align: center;">人防车位</th>
            <th style="text-align: center;">小计</th>
            <th style="text-align: center;">普通车位</th>
            <th style="text-align: center;">人防车位</th>
            <th style="text-align: center;">小计</th>
            <th style="text-align: center;">已选申购金额</th>
            <th style="text-align: center;">已结清申购金额</th>
        </tr>
    <#assign index = 0/>
    <#assign allContractCountSum = 0/>
    <#assign allLimitHouseAreaSum = 0/>
    <#--未用-->
    <#assign allMoreCountSum = 0/>
    <#assign allMoreMoneySum = 0/>
    <#--未用-->
    <#assign allLessCountSum = 0/>
    <#assign allLessMoneySum = 0/>
    <#assign allFinalMoneySum = 0/>
    <#assign allWxMoneySum = 0/>
    <#assign allCarLotMoneySum = 0/>
    <#--未用-->
    <#assign allNormalHouseCountSum = 0/>
    <#--未用-->
    <#assign allNormalHouseAreaSum = 0/>
    <#--未用-->
    <#assign allSmallHouseCountSum = 0/>
    <#assign allFsHouseCountSum = 0/>
    <#--未用-->
    <#assign allSmallHouseAreaSum = 0/>
    <#assign all0100HouseCountSum = 0/>
    <#--未用-->
    <#assign all0100HouseAreaSum = 0/>
    <#assign all0102HouseCountSum = 0/>
    <#--未用-->
    <#assign all0102HouseAreaSum = 0/>

    <#assign all0202HouseCountSum = 0/>
    <#--未用-->
    <#assign all0202HouseAreaSum = 0/>
    <#assign all0302HouseCountSum = 0/>
    <#--未用-->
    <#assign all0302HouseAreaSum = 0/>
    <#assign all0402HouseCountSum = 0/>
    <#--未用-->
    <#assign all0402HouseAreaSum = 0/>
    <#assign all0502HouseCountSum = 0/>
    <#--未用-->
    <#assign all0502HouseAreaSum = 0/>
    <#assign allHouseCountSum = 0/>
    <#assign allHouseAreaSum = 0/>

    <#assign allShopHouseCountSum = 0/>
    <#assign allShopHouseAreaSum = 0/>
    <#assign allStorageRoomCountSum = 0/>
    <#assign allStorageRoomAreaSum = 0/>
    <#assign allPtCarLotCountSum = 0/>
    <#assign allRfCarLotCountSum = 0/>
    <#assign allCarLotCountSum = 0/>
    <#assign allCarLotMoneySum = 0/>
    <#assign allPtCarLotFinanceSettleStatusCountSum = 0/>
    <#assign allRfCarLotFinanceSettleStatusCountSum = 0/>
    <#assign allCarLotFinanceSettleStatusCountSum = 0/>
    <#assign allCarLotFinanceSettleStatusMoneySum = 0/>

    <#if zsProjectList?size !=0>
        <#list zsProjectList as zsProject>
            <#assign contractCountMap = (contractMap[zsProject.id?c])!/>
            <#assign houseCountMap = (houseMap[zsProject.id?c])!/>
            <#assign storageRoomCountMap= (storageRoomMap[zsProject.id?c])!/>
            <#assign shopHouseCountMap= (shopHouseMap[zsProject.id?c])!/>
            <#assign carLotCountMap = (carLotMap[zsProject.id?c])! />
            <#assign index = index+1 />

            <#assign allContractCountSum = allContractCountSum + (contractCountMap['contractTotal'])!0/>
            <#assign allLimitHouseAreaSum = allLimitHouseAreaSum + (contractCountMap['limitHouseAreaTotal'])!0/>
        <#--未用-->
            <#assign allMoreCountSum = allMoreCountSum + (contractCountMap['moreCount'])!0/>
            <#assign allMoreMoneySum = allMoreMoneySum + (contractCountMap['moreMoney'])!0/>
        <#--未用-->
            <#assign allLessCountSum = allLessCountSum + (contractCountMap['lessCount'])!0/>
            <#assign allLessMoneySum = allLessMoneySum + (contractCountMap['lessMoney'])!0/>
            <#assign allWxMoneySum = allWxMoneySum + (contractCountMap['wxMoney'])!0/>
            <#assign allFinalMoneySum = allFinalMoneySum + (contractCountMap['finalMoney'])!0/>

            <#assign allNormalHouseCountSum = allNormalHouseCountSum + (houseCountMap['normalHouseNum'])!0/>
            <#assign allFsHouseCountSum = allFsHouseCountSum + (houseCountMap['fsHouseNum'])!0/>
        <#--未用-->
            <#assign allNormalHouseAreaSum = allNormalHouseAreaSum + (houseCountMap['normalHouseArea'])!0/>
        <#--未用-->
            <#assign allSmallHouseCountSum = allSmallHouseCountSum + (houseCountMap['smallHouseNum'])!0/>
        <#--未用-->
            <#assign allSmallHouseAreaSum = allSmallHouseAreaSum + (houseCountMap['smallHouseArea'])!0/>
        <#--未用-->

            <#assign all0100HouseCountSum = all0100HouseCountSum + (houseCountMap['0100HouseNum'])!0/>
            <#assign all0100HouseAreaSum = all0100HouseAreaSum + (houseCountMap['0100HouseArea'])!0/>
            <#assign all0102HouseCountSum = all0102HouseCountSum + (houseCountMap['0102HouseNum'])!0/>
            <#assign all0102HouseAreaSum = all0102HouseAreaSum + (houseCountMap['0102HouseArea'])!0/>
            <#assign all0202HouseCountSum = all0202HouseCountSum + (houseCountMap['0202HouseNum'])!0/>
            <#assign all0202HouseAreaSum = all0202HouseAreaSum + (houseCountMap['0202HouseArea'])!0/>
            <#assign all0302HouseCountSum = all0302HouseCountSum + (houseCountMap['0302HouseNum'])!0/>
            <#assign all0302HouseAreaSum = all0302HouseAreaSum + (houseCountMap['0302HouseArea'])!0/>
            <#assign all0402HouseCountSum = all0402HouseCountSum + (houseCountMap['0402HouseNum'])!0/>
            <#assign all0402HouseAreaSum = all0402HouseAreaSum + (houseCountMap['0402HouseArea'])!0/>
            <#assign all0502HouseCountSum = all0502HouseCountSum + (houseCountMap['0502HouseNum'])!0/>
            <#assign all0502HouseAreaSum = all0502HouseAreaSum + (houseCountMap['0502HouseArea'])!0/>

            <#assign allHouseCountSum = allHouseCountSum + (houseCountMap['houseNum'])!0/>
            <#assign allHouseAreaSum = allHouseAreaSum + (houseCountMap['houseArea'])!0/>
            <#assign allShopHouseCountSum = allShopHouseCountSum + (shopHouseCountMap['shopHouseTotal'])!0/>
            <#assign allShopHouseAreaSum = allShopHouseAreaSum + (shopHouseCountMap['shopHouseArea'])!0/>
            <#assign allStorageRoomCountSum = allStorageRoomCountSum + (storageRoomCountMap['storageRoomTotal'])!0/>
            <#assign allStorageRoomAreaSum = allStorageRoomAreaSum + (storageRoomCountMap['storageRoomArea'])!0/>
            <#assign allCarLotCountSum = allCarLotCountSum + (carLotCountMap['chooseCount'])!0/>
            <#assign allPtCarLotCountSum = allPtCarLotCountSum + (carLotCountMap['ptChoose'])!0/>
            <#assign allRfCarLotCountSum = allRfCarLotCountSum + (carLotCountMap['rfChoose'])!0/>
            <#assign allCarLotMoneySum = allCarLotMoneySum + (carLotCountMap['choosePrice'])!0/>
            <#assign allCarLotFinanceSettleStatusCountSum = allCarLotFinanceSettleStatusCountSum + (carLotCountMap['financeSettleStatusCount'])!0/>
            <#assign allPtCarLotFinanceSettleStatusCountSum = allPtCarLotFinanceSettleStatusCountSum + (carLotCountMap['ptFinanceSettleStatusCount'])!0/>
            <#assign allRfCarLotFinanceSettleStatusCountSum = allRfCarLotFinanceSettleStatusCountSum + (carLotCountMap['rfFinanceSettleStatusCount'])!0/>
            <#assign allCarLotFinanceSettleStatusMoneySum = allCarLotFinanceSettleStatusMoneySum + (carLotCountMap['financeSettleStatusMoney'])!0/>


            <tr <#if index%10 lte 5 && index%10 gt 0>style="background-color: #FFCC99"</#if>>
                <td>${(index)!0}</td>
                <td>
                    <a href="contractShow.ftl?azProjectId=${(azProject.id)!}&zsProjectId=${(zsProject.id)!}"
                       style="font: inherit">${(zsProject.projectName)!}</a>
                </td>
                <td>
                    <a href="contractShow.ftl?azProjectId=${(azProject.id)!}&zsProjectId=${(zsProject.id)!}"
                       style="font: inherit">${(contractCountMap['contractTotal'])!0}
                </td>
                <td>
                    <a href="contractShow.ftl?azProjectId=${(azProject.id)!}&zsProjectId=${(zsProject.id)!}"
                       style="font: inherit">${(contractCountMap['limitHouseAreaTotal'])!0}
                </td>
                <td>${(zsProject.startYear?string('yyyy年MM月dd日'))!}</td>
                <td>
                    <a href="selectedHouseShow.ftl?azProjectId=${(azProject.id)!}&zsProjectId=${(zsProject.id)!}&houseHold=0100"
                       style="font: inherit">${(houseCountMap['0100HouseNum'])!0}
                </td>
                <td>
                    <a href="selectedHouseShow.ftl?azProjectId=${(azProject.id)!}&zsProjectId=${(zsProject.id)!}&houseHold=0102"
                       style="font: inherit">${(houseCountMap['0102HouseNum'])!0}
                </td>
                <td>
                    <a href="selectedHouseShow.ftl?azProjectId=${(azProject.id)!}&zsProjectId=${(zsProject.id)!}&houseHold=0202"
                       style="font: inherit">${(houseCountMap['0202HouseNum'])!0}
                </td>
                <td>
                    <a href="selectedHouseShow.ftl?azProjectId=${(azProject.id)!}&zsProjectId=${(zsProject.id)!}&houseHold=0302"
                       style="font: inherit">${(houseCountMap['0302HouseNum'])!0}
                </td>
                <td>
                    <a href="selectedHouseShow.ftl?azProjectId=${(azProject.id)!}&zsProjectId=${(zsProject.id)!}&houseHold=0402"
                       style="font: inherit">${(houseCountMap['0402HouseNum'])!0}
                </td>
                <td>
                    <a href="selectedHouseShow.ftl?azProjectId=${(azProject.id)!}&zsProjectId=${(zsProject.id)!}&houseHold=0502"
                       style="font: inherit">${(houseCountMap['0502HouseNum'])!0}
                </td>
                <td>
                    <a href="selectedHouseShow.ftl?azProjectId=${(azProject.id)!}&zsProjectId=${(zsProject.id)!}&houseType=01"
                       style="font: inherit">${(houseCountMap['normalHouseNum'])!0}
                </td>
                <td>
                    <a href="selectedHouseShow.ftl?azProjectId=${(azProject.id)!}&zsProjectId=${(zsProject.id)!}&houseType=03"
                       style="font: inherit">${(houseCountMap['fsHouseNum'])!0}
                </td>
                <td>
                    <a href="selectedHouseShow.ftl?azProjectId=${(azProject.id)!}&zsProjectId=${(zsProject.id)!}"
                       style="font: inherit">${(houseCountMap['houseNum'])!0}
                </td>
                <td>
                    <a href="selectedHouseShow.ftl?azProjectId=${(azProject.id)!}&zsProjectId=${(zsProject.id)!}"
                       style="font: inherit">${(houseCountMap['houseArea'])!0}
                </td>
                <td><a href="selectedShopHouseShow.ftl?azProjectId=${(azProject.id)!}&zsProjectId=${(zsProject.id)!}"
                       style="font: inherit">
                ${(shopHouseCountMap['shopHouseTotal'])!0}</td>
                <td><a href="selectedShopHouseShow.ftl?azProjectId=${(azProject.id)!}&zsProjectId=${(zsProject.id)!}"
                       style="font: inherit">
                ${(shopHouseCountMap['shopHouseArea'])!0}</td>
                <td><a href="selectedStorageRoomShow.ftl?azProjectId=${(azProject.id)!}&zsProjectId=${(zsProject.id)!}"
                       style="font: inherit">
                ${(storageRoomCountMap['storageRoomTotal'])!0}</td>
                <td><a href="selectedStorageRoomShow.ftl?azProjectId=${(azProject.id)!}&zsProjectId=${(zsProject.id)!}"
                       style="font: inherit">
                ${(storageRoomCountMap['storageRoomArea'])!0}</td>
                <td>
                    <a href="selectedCarLotShow.ftl?azProjectId=${(azProject.id)!}&zsProjectId=${(zsProject.id)!}&carLotType=1,2,3"
                       style="font: inherit">${(carLotCountMap['ptChoose'])!0}</td>
                <td>
                    <a href="selectedCarLotShow.ftl?azProjectId=${(azProject.id)!}&zsProjectId=${(zsProject.id)!}&carLotType=4,5,6"
                       style="font: inherit">${(carLotCountMap['rfChoose'])!0}</td>
                <td><a href="selectedCarLotShow.ftl?azProjectId=${(azProject.id)!}&zsProjectId=${(zsProject.id)!}"
                       style="font: inherit">
                ${(carLotCountMap['chooseCount'])!0}</td>
                <td>
                    <a href="selectedCarLotShow.ftl?azProjectId=${(azProject.id)!}&zsProjectId=${(zsProject.id)!}&financeSettleStatus=2&carLotType=1,2,3"
                       style="font: inherit">${(carLotCountMap['ptFinanceSettleStatusCount'])!0}</td>
                <td>
                    <a href="selectedCarLotShow.ftl?azProjectId=${(azProject.id)!}&zsProjectId=${(zsProject.id)!}&financeSettleStatus=2&carLotType=4,5,6"
                       style="font: inherit">${(carLotCountMap['rfFinanceSettleStatusCount'])!0}</td>
                <td>
                    <a href="selectedCarLotShow.ftl?azProjectId=${(azProject.id)!}&zsProjectId=${(zsProject.id)!}&financeSettleStatus=2"
                       style="font: inherit">
                ${(carLotCountMap['financeSettleStatusCount'])!0}</td>
                <td>${(carLotCountMap['choosePrice'])!0}</td>
                <td>${(carLotCountMap['financeSettleStatusMoney'])!0}</td>
                <td>${(0-contractCountMap['wxMoney'])!0}</td>
                <td>${(contractCountMap['moreMoney'])!0}</td>
                <td>${(0-contractCountMap['lessMoney'])!0}</td>
                <td>
                    <a href="contractShow.ftl?azProjectId=${(azProject.id)!}&zsProjectId=${(zsProject.id)!}"
                       style="font: inherit">${(0-contractCountMap['finalMoney'])!0}
                </td>

            </tr>
        </#list>
    </#if>
        <tr bgcolor="#b0c4de">
            <td colspan="2">合计</td>
            <td><a href="contractShow.ftl?azProjectId=${(azProject.id)!}" style="font: inherit">${allContractCountSum}
            </td>
            <td><a href="contractShow.ftl?azProjectId=${(azProject.id)!}" style="font: inherit">${allLimitHouseAreaSum}
            </td>
            <td></td>
            <td><a href="selectedHouseShow.ftl?azProjectId=${(azProject.id)!}&houseHold=0100"
                   style="font: inherit">${all0100HouseCountSum}</td>
            <td><a href="selectedHouseShow.ftl?azProjectId=${(azProject.id)!}&houseHold=0102"
                   style="font: inherit">${all0102HouseCountSum}</td>
            <td><a href="selectedHouseShow.ftl?azProjectId=${(azProject.id)!}&houseHold=0202"
                   style="font: inherit">${all0202HouseCountSum}</td>
            <td><a href="selectedHouseShow.ftl?azProjectId=${(azProject.id)!}&houseHold=0302"
                   style="font: inherit">${all0302HouseCountSum}</td>
            <td><a href="selectedHouseShow.ftl?azProjectId=${(azProject.id)!}&houseHold=0402"
                   style="font: inherit">${all0402HouseCountSum}</td>
            <td><a href="selectedHouseShow.ftl?azProjectId=${(azProject.id)!}&houseHold=0502"
                   style="font: inherit">${all0502HouseCountSum}</td>
            <td><a href="selectedHouseShow.ftl?azProjectId=${(azProject.id)!}&houseType=01"
                   style="font: inherit">${allNormalHouseCountSum}</td>
            <td><a href="selectedHouseShow.ftl?azProjectId=${(azProject.id)!}&houseType=03"
                   style="font: inherit">${allFsHouseCountSum}</td>
            <td><a href="selectedHouseShow.ftl?azProjectId=${(azProject.id)!}" style="font: inherit">${allHouseCountSum}
            </td>
            <td><a href="selectedHouseShow.ftl?azProjectId=${(azProject.id)!}" style="font: inherit">${allHouseAreaSum}
            </td>
            <td><a href="selectedShopHouseShow.ftl?azProjectId=${(azProject.id)!}"
                   style="font: inherit">${allShopHouseCountSum}</td>
            <td><a href="selectedShopHouseShow.ftl?azProjectId=${(azProject.id)!}"
                   style="font: inherit">${allShopHouseAreaSum}</td>
            <td><a href="selectedStorageRoomShow.ftl?azProjectId=${(azProject.id)!}"
                   style="font: inherit">${allStorageRoomCountSum}</td>
            <td><a href="selectedStorageRoomShow.ftl?azProjectId=${(azProject.id)!}"
                   style="font: inherit">${allStorageRoomAreaSum}</td>
            <td><a href="selectedCarLotShow.ftl?azProjectId=${(azProject.id)!}&carLotType=1,2,3"
                   style="font: inherit">${allPtCarLotCountSum}</td>
            <td><a href="selectedCarLotShow.ftl?azProjectId=${(azProject.id)!}&carLotType=4,5,6"
                   style="font: inherit">${allRfCarLotCountSum}</td>
            <td><a href="selectedCarLotShow.ftl?azProjectId=${(azProject.id)!}"
                   style="font: inherit">${allCarLotCountSum}</td>

            <td><a href="selectedCarLotShow.ftl?azProjectId=${(azProject.id)!}&financeSettleStatus=2&carLotType=1,2,3"
                   style="font: inherit">${allPtCarLotFinanceSettleStatusCountSum}</td>
            <td><a href="selectedCarLotShow.ftl?azProjectId=${(azProject.id)!}&financeSettleStatus=2&carLotType=4,5,6"
                   style="font: inherit">${allRfCarLotFinanceSettleStatusCountSum}</td>
            <td><a href="selectedCarLotShow.ftl?azProjectId=${(azProject.id)!}&financeSettleStatus=2"
                   style="font: inherit">${allCarLotFinanceSettleStatusCountSum}</td>
            <td>${allCarLotMoneySum}</td>
            <td>${allCarLotFinanceSettleStatusMoneySum}</td>
            <td>${0-allWxMoneySum}</td>
            <td>${allMoreMoneySum}</td>
            <td>${0-allLessMoneySum}</td>
            <td><a href="contractShow.ftl?azProjectId=${(azProject.id)!}" style="font: inherit">${0-allFinalMoneySum}
            </td>
        </tr>
    </table>
</div>

